# -*- coding: utf-8 -*-
# @Time    : 2021/11/22 
# @Author  : 杨玉磊
# @Email   : mat_wu@163.com
# @File    : serializers.py
# @Software: PyCharm
from rest_framework import serializers
from .models import User

class UsersSer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = '__all__'


# class UsersSer(serializers.ModelSerializer):
#     def create(self, validated_data):
#         user = User()
#         role = Role()
#         user.username = validated_data['username']
#         user.password = validated_data['password']
#         user.phone = validated_data['phone']
#         role.role_id = validated_data['role_id']
#         user.email = validated_data['email']
#         role.save()
#         user.save()
#     class Meta:
#         model = User
#         fields = '__all__'